//
//  HWOpenTheRecordViewController.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/10/31.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWOpenTheRecordViewController.h"
#import "HWIncomeMingXiCell.h"

@interface HWOpenTheRecordViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(strong,nonatomic) UITableView *mainaTableVie;
@end

@implementation HWOpenTheRecordViewController

-(UITableView *)mainaTableVie {

    if  (_mainaTableVie == nil) {

        _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH) style:UITableViewStylePlain];
        _mainaTableVie.delegate = self;
        _mainaTableVie.dataSource = self;
        _mainaTableVie.separatorStyle = UITableViewCellSeparatorStyleNone;
        
        _mainaTableVie.backgroundColor = [UIColor whiteColor];
       // _mainaTableVie.backgroundColor = RGB(241, 242, 244);
        
    }
    return   _mainaTableVie ;

}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupUI];
}

- (void)setupUI {
    self.navigationItem.title = @"开通记录";
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.mainaTableVie];
    self.mainaTableVie.backgroundColor = RGB(242, 242, 242);
    
    
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellID = @"cellID";
    
    HWIncomeMingXiCell  *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
        cell = [[HWIncomeMingXiCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        
    }
    cell.selectionStyle   =  UITableViewCellSelectionStyleNone;
    cell.backgroundColor = [UIColor whiteColor];
    

    return  cell;
    
    
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    
    return  36;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    
    
    
    return  36;
}


- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 36)];
    view.backgroundColor = RGB(233, 241, 255);
    NSArray *arr = @[@"时间",@"金额",@"备注"];
    for (int i = 0; i < 3; i++) {
        
        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(kScreenW/3*i, 0, kScreenW/3, 36)];
        label.text = arr[i];
        label.font = [UIFont systemFontOfSize:13];
        label.textColor = RGB(51, 51, 51);
        label.textAlignment = NSTextAlignmentCenter;
        [view addSubview:label];
        
    }
    
    for (int i = 0 ; i < 2 ; i++) {
        UIView *shuxiangView = [[UIView alloc]initWithFrame:CGRectMake(kScreenW/3*(i+1), 0, 1, 36)];
        shuxiangView.backgroundColor = RGB(232, 232, 242);
        [view addSubview:shuxiangView];
    }
    
    return  view;
    
}

@end
